package com.kou.spring;

import com.kou.spring.bean.Person;
import com.kou.spring.config.MainConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 注解版Spring的用法
 */
public class AnnotationMainTest {

	public static void main(String[] args) {

		//传入配置类
		ApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfig.class);

		Person person = applicationContext.getBean(Person.class);
		System.out.println(person);
	}
}
